/*
 * @Author: 刘润泽
 * @Date: 2023-02-22 19:39:56
 * @LastEditors: 刘润泽
 * @LastEditTime: 2023-03-14 19:54:44
 * @Description: 
 */
package server.business.pojo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 血液数据
 *
 * @author ccb
 * @date 2022/07/25
 */
@Data
@Accessors(chain = true)
@TableName("blood_sample")
@ColumnWidth(20) //列宽
@ContentRowHeight(20)//数据行高
@HeadRowHeight(30)//表头高

@ExcelIgnoreUnannotated   //解决不加ExcelProperty注解的，也会出现在excel中
public class SampleData {
    @TableId(type = IdType.AUTO)
    private Long id;     //id
    
    @TableField(value = "gmt_create",fill = FieldFill.INSERT)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;   //创建时间
    
    @TableField(value = "gmt_modified", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "更新时间",index = 3)
    private Date gmtModified;    //更新时间
    
    @TableField(value = "number")
    @ExcelProperty(value = "血液样本编号",index = 0)
    private String number;      //血液样本编号
    
    @TableField(value = "blood_number")
    @ExcelProperty(value = "血液编号",index = 1)
    private String bloodNumber;    //血液编号
    
    @TableField(value = "collect_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "采集日期",index = 2)
    private Date collectTime;    //采集日期
    
    @TableField(value = "state")
    @ExcelProperty(value = "状态",index = 4)
    private String state;   //状态
    
    @TableField(value = "location")
    @ExcelProperty(value = "位置",index = 5)
    private String location;     //样本位置
    
    @TableField(value = "operator")
    @ExcelProperty(value = "操作员",index = 6)
    private String operator;     //操作员
    
    @TableField(value = "operator_number")
    @ExcelProperty(value = "操作员编号",index = 7)
    private String operatorNumber;     //操作员编号

    @TableField(value = "is_deleted", fill = FieldFill.INSERT)
    @TableLogic(value = "0", delval = "1")
    private int isDeleted;     //删除标记（0代表未删除，1代表删除）
    
    @TableField(exist = false)
    private String stateInfo;   //标本状态中文含义
}
